﻿package mortal.game.net.command.shop
{
    import Framework.MQ.*;
    import Message.Game.*;
    import Message.Public.*;
    import com.gengine.debug.*;
    import mortal.game.mvc.*;
    import mortal.game.net.broadCast.*;
    import mortal.mvc.core.*;

    public class BuyBackUpdateCommand extends BroadCastCall
    {

        public function BuyBackUpdateCommand(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function call(param1:MessageBlock) : void
        {
            Log.debug("I have receive BuyBackUpdateCommand");
            var _loc_2:* = param1.messageBase as SBuyBackItemMsg;
            switch(_loc_2.type)
            {
                case EUpdateType._EUpdateTypeAdd:
                {
                    _cache.shop.buyBackList.unshift(_loc_2.item);
                    break;
                }
                case EUpdateType._EUpdateTypeDel:
                {
                    _cache.shop.removeBuyBackItemByUid(_loc_2.item.uid);
                    break;
                }
                default:
                {
                    break;
                }
            }
            NetDispatcher.dispatchCmd(ServerCommand.updateBuyBackList, null);
            return;
        }// end function

    }
}
